package com.yibo.yunpicture.interfaces.assembler;

import com.yibo.yunpicture.domain.space.entity.Space;
import com.yibo.yunpicture.interfaces.dto.space.SpaceAddDTO;
import com.yibo.yunpicture.interfaces.dto.space.SpaceEditDTO;
import com.yibo.yunpicture.interfaces.dto.space.SpaceUpdateDTO;
import org.springframework.beans.BeanUtils;

/**
 * 空间对象转换
 */
public class SpaceAssembler {

    public static Space toSpaceEntity(SpaceAddDTO request) {
        Space space = new Space();
        BeanUtils.copyProperties(request, space);
        return space;
    }

    public static Space toSpaceEntity(SpaceUpdateDTO request) {
        Space space = new Space();
        BeanUtils.copyProperties(request, space);
        return space;
    }

    public static Space toSpaceEntity(SpaceEditDTO request) {
        Space space = new Space();
        BeanUtils.copyProperties(request, space);
        return space;
    }
}
